<html>
	<head>
		<meta charset="utf-8"> 
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
		<script src="http://code.jquery.com/jquery.js"></script>
		<script src="http://maps.google.com/maps/api/js?v=3.3&sensor=true"></script>
		<script src="json2.js"></script>
		<script src="modernizr-1.7.min.js"></script>
		<script type="text/javascript">
		//<!--
		var latitude;
		var longitude;
		
		$(function()
			{
				var o = new Object();
				o.req = "GET_PERFORMANCE_DETAIL";
	<?php
			echo "o.performance_seq =" . $_REQUEST["performance_seq"] . ";\n";
	?>	
				var url = "http://gilstar.com/gilstar/Performance.jsp";
				getJSON(url, o);			
			});

	function getJSON(url, json)
	{
		var requestStr = JSON.stringify(json, replacer);
		
		$.ajax(
			{
				url: url,
				data: requestStr,
				type: "POST",
				success: function(data)
				{
					var resultObject = jQuery.parseJSON(data);
					jsonResponseHandler(resultObject);
				}
			});
	}

	function jsonResponseHandler(result)
	{
		if(result.ResultCode == -1)			//처리 도중 실패.
		{
			alert(result.ResultMessage);
		}
		else if(result.ResultCode == 0)	//성공적으로 처리 완료.
		{
			var item = result.ResultMethod[0];
			var imagePath = item.file_name;
			
			$("#listThumb img").attr({src : imagePath});
			$(".listH").html(item.title);
			$(".listType").html(item.category + "/" + item.artist);
			$(".listTime").html("<time datetime>" + item.time + "</time>");
			$(".listLoc").html("<a href='#' onclick='showMap();'>" + item.address + "</a>");
			

			$(".introduce_p").html(item.content);
			$(".otherInfoA").html(item.youtube_link);
			$(".snsInfo").html(item.sns_url);

			latitude = item.latitude;
			longitude = item.longitude;
		}
	}

	function showMap()
	{
		$(".map_api").css("width", "300");
		$(".map_api").css("height", "300");

		var currentLocation = new google.maps.LatLng(latitude, longitude);
		//alert(currentLocation);
		var myOptions = { zoom: 15, center: currentLocation, mapTypeId: google.maps.MapTypeId.ROADMAP };
		var map = new google.maps.Map(document.getElementById("mapView"), myOptions);			

		var marker = new google.maps.Marker(
			{
					position : currentLocation,
					title : "my location",
					map : map
			});
	}

	function replacer(key, value) 
	{
	    if (typeof value === 'number' && !isFinite(value)) 
	    {
	        return String(value);
	    }
	    return value;
	}
//-->
		</script>
	</head>
	<body>
		<!-- 상세 보기 -->
		<section id="view"> 
			<div class="listLi"> 
				<img width="94" height="92" class="listThumb" id="listThumb"/> 
				<div class="listContent"> 
					<h1 class="listH"></h1> 
					<div class="listType"></div> 
					<div class="listTime"> 
					</div> 
					<div class="listLoc"></div> 
				</div>
				<div class="map_api" id="mapView"> 
				</div> 
				
				<div class="introduce">
					<h2 class="introduce_h">소개글 <span class="introduce_h_desc">Introduce</span></h2>
					<p class="introduce_p">
					</p>
				</div>
				
				<div class="otherInfo">
					<h2 class="hidden">추가 정보</h2>
					<ul class="otherInfoUl">
					<li class="otherInfoLi">
						<span class="icon">동영상:</span>
						<span class="otherInfoA"></span>
					</li>
					<li class="otherInfoLi">
						<span class="icon">SNS:</span>
						<span class="snsInfo"></span>
					</li>
					</ul>
				</div>
		
				<h2 class="hidden">친구들과 공유하기</h2>
				<div class="share">
					<span class="shareCell shareBtnFacebook">
						<button type="button" class="shareBtn">facebook</button>
					</span>
					<span class="shareCell shareBtnTwitter">
						<button type="button" class="shareBtn">twitter</button>
					</span>
					<span class="shareCell shareBlank"></span>
					<span class="shareCell shareBtnCopy">
						<button type="button" class="shareBtn">주소복사</button>
					</span>
				</div>

			</div> 
			<div class="btnListWrap">
				<a href="list.php" class="btnList">목록보기</a>
			</div>
		</section> 
		<!-- //상세 보기 --> 
	</body>
</html>